﻿#ifndef _FILENAME_CREATE_H_
#define  _FILENAME_CREATE_H_

#include "rec_info.h"
#include "cross_com.h"
#include <string>

class CFilename_Createer
{
public:
	CFilename_Createer();
	~CFilename_Createer();

	int Init(char * rootDir,char * norDir,char * evtDir,char * captureDir,char * thumbnailDir,char * separtor,int fBoxType,int chNum = 1);

	int GetFilePath(char * filePath,int fileType,time_t curTime,int channel);

	int GetPicFile(string & picName,time_t curTime,int channel);

	int Create_fname(char* fileName, int fileType,time_t curTime,int channel = 0);

	//设置正常录像目录
	void SetDir_NormalRec(char * dir);
	char * GetDir_NorRec();
	//设置报警录像目录
	void SetDir_EvtRec(char * dir);
	char * GetDir_EvtRec();

	//设置抓拍目录
	void SetDir_Capture(char * dir);
	char * GetDir_Capture();

	//设置缩略图目录
	void SetDir_thumbnail(char * dir);
	char * GetDir_thumbnail();
	char * GetDir(int fileType);
	void GetPath(int fileType,string & path);;
	char * GetDir_mount();
	void GetFileNameExt(char * fname_ext);
#ifdef _SIMULATE_RECORD_
	void SetMntDir(char * mnt_dir)
	{
		strcpy(m_filePath,mnt_dir);
		CreateRecDir();
	}
#endif
protected:
	void GetTimeStr(char * tmStr,time_t curTime);

	int CreateRecDir();
private:
	char   m_filePath[60];
	char   m_norRecDir[16];
	char   m_evtRecDir[16];
	char   m_captureDir[16];
	char   m_thumbnailDir[24];
	char   m_separtor[8];		
	int    m_fBoxType;
	int    m_chNom;
};


#endif
